package com.njtoyo.taxi.admin.rest.controller.business.call;

import com.njtoyo.taxi.admin.aop.PermissionScope;
import com.njtoyo.taxi.admin.rest.wrapper.business.call.NoResponseCustomerMobileNumberExportWrapper;
import com.njtoyo.taxi.admin.service.business.ride.CallsService;
import com.njtoyo.taxi.entity.backend.AdminUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;

@RestController
@Api(value = "呼叫", tags = "呼叫")
@RequestMapping("business/call")
public class CallController {

    @Autowired
    private CallsService callsService;

    @GetMapping("/no-response-customer-mobile-number-export")
    @ApiOperation(value = "叫车无应答导出", notes = "只返回账号下的数据，无接口权限校验, 权限：call_no_reply_export")
    @PermissionScope(names = {"call_no_reply_export"})
    void noResponseCustomerMobileNumberExport(@ApiIgnore @ModelAttribute("admin") AdminUser adminUser, @Valid NoResponseCustomerMobileNumberExportWrapper wrapper, HttpServletResponse response) throws IOException {
        callsService.getNoResponseCustomerMobileNumberExport(adminUser, wrapper, response);
    }
}
